<template>
	<view class="content">
		<view class="info-block">
			<view class="info-list" v-for="(item,index) in list" :key="item.id"
				@click="navigate('/page_other/job_hunting/job_list/index?type=1&name=找全职&id='+item.id)">
				<view class="info-item" style="background: #EAFAED;" v-if="index+1
				==1||index+1==5||index+1==9||index+1==13||index+1==17">
					<view class="title">{{item.name}}</view>
					<view class="arrow-item">
						<view class="count">{{item.count}}个</view>
						<view class="circular">
							<view class="arrow">→</view>
						</view>
					</view>
				</view>
				<view class="info-item" style="background: #FFF5F4;" v-else-if="index+1
				==2||index+1==6||index+1==10||index+1==14||index+1==18">
					<view class="title">{{item.name}}</view>
					<view class="arrow-item">
						<view class="count">{{item.count}}个</view>
						<view class="circular">
							<view class="arrow">→</view>
						</view>
					</view>
				</view>
				<view class="info-item" style="background: #FEF7ED;" v-else-if="index+1
				==3||index+1==7||index+1==11||index+1==15||index+1==19||index+1==23">
					<view class="title">{{item.name}}</view>
					<view class="arrow-item">
						<view class="count">{{item.count}}个</view>
						<view class="circular">
							<view class="arrow">→</view>
						</view>
					</view>
				</view>
				<view class="info-item" style="background: #EBFAFF;" v-else-if="index+1
				==4||index+1==8||index+1==12||index+1==16||index+1==20">
					<view class="title">{{item.name}}</view>
					<view class="arrow-item">
						<view class="count">{{item.count}}个</view>
						<view class="circular">
							<view class="arrow">→</view>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		getStreetListApi
	} from '@/api/accept.js'
	export default {
		data() {
			return {
				list: []
			}
		},
		methods: {
			navigate(url) {
				uni.navigateTo({
					url
				})
			},
			getList() {
				getStreetListApi({}).then((res) => {
					this.list = res ?? [];
				})
			},
		},
		onLoad() {
			this.getList()
		}
	}
</script>

<style lang="scss">
	.content {
		width: 100%;
		background: #fff;
		padding: 30rpx 10rpx 30rpx 30rpx;

		.info-block {
			display: flex;
			flex-direction: row;
			flex-wrap: wrap;

			.info-list {
				width: calc(100% / 3);

				.info-item {
					margin-right: 20rpx;
					height: 200rpx;
					display: flex;
					flex-direction: column;
					margin-bottom: 20rpx;
					border-radius: 20rpx;
					display: flex;
					align-items: center;
					justify-content: center;
					padding: 30rpx;

					.title {
						font-size: 30rpx;
					}

					.arrow-item {
						width: 100%;
						display: flex;
						justify-content: space-between;
						margin-top: 40rpx;
						align-items: center;

						.count {
							color: #E99F21;
						}

						.circular {
							width: 36rpx;
							height: 36rpx;
							border-radius: 50%;
							border: 1px solid #E99F21;
							text-align: center;

							.arrow {
								font-size: 24rpx;
								color: #E99F21;
								font-weight: bold;
							}
						}
					}
				}

				.info-item:nth-child(1n) {
					background-color: #EAFAED;
				}

				.info-item:nth-child(2n) {
					background-color: #FFF5F4;
				}

				.info-item:nth-child(3n) {
					margin-right: 0;
					background-color: #FDF7EB;
				}

				.info-item:nth-child(4n) {
					background: #EAF9FE;
				}
			}
		}
	}
</style>